import 'package:get/get.dart';
import 'package:ball_lion/server/api/home_api.dart';
import 'package:ball_lion/utils/toast_utils.dart';
import 'package:ball_lion/widgets/select_bottomsheet.dart';

class ReportSheet {
  static reportPost(int id) async {
    final opts = ["淫秽色情", "营销广告", "网络暴力", "违法信息", "虚假谣言"];
    final s = await Get.bottomSheet(SelectBottomSheet(List.from(opts)));
    if (s < 0 || s >= opts.length) {
      return;
    }
    final result = await HomeApi.newsSupport(id, type: 5, comment: opts[s]);
    if (result == 200) {
      Toast.text('举报成功');
    }
  }
}
